home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!willen.demon.co.uk
- From: Adrian Parker <adrian@willen.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: watcom c 10.5.. bug ?
- Date: Tue, 09 Apr 96 16:00:04 GMT
- Organization: Quondam Ltd
- Message-ID: <829065604snz@willen.demon.co.uk>
- Reply-To: adrian@willen.demon.co.uk
- X-NNTP-Posting-Host: willen.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.30
- X-Mail2News-Path: willen.demon.co.uk
-
-
- Compiler is watcom 10.5a.
-
- I have a problem with a program I've been writing, and have tracked it
- down to the following..
-
- ......................................................................
- #include <stdio.h>
- #include <stdlib.h>
-
- struct {
- char c1[15];
- int i1;
- char c2[4];
- } array[101][101];
-
- main()
- {
- printf("c1 %p\n",array[30][90].c1);
- printf("c2 %p\n",array[30][90].c2);
- /*
- array[30][90].i1 = 1;
- */
- }
- ......................................................................
-
- Compiling & running from msdos with wcl work.c -ml -w4
-
- -ml = large model
- -w4 = show all warnings
-
- The output I get is..
-
- c1 1f99:fff0
- c2 2f99:0001
-
- So it looks like the int variable array[30][90].i1 is crossing a
- segment boundary.
-
- If the last line is uncommented, it just hangs.
-
- Has anyone else had any problems with this compiler doing odd things
- with memory ?
-
- Rgards,
- Adrian
- --
- :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
- :: Adrian Parker adrian@willen.demon.co.uk Quondam Ltd ::
- :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
-